package com.xlhj.elastic.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author: liucaijing
 * @description: Product
 * @date: 2021/5/11 16:27
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Document(createIndex = true, indexName = "productInfo", shards = 3, replicas = 1)
public class Product {

    @Id
    private Long id;

    @Field(type = FieldType.Text, analyzer = "ik max word")
    private String title;

    @Field(type= FieldType.Keyword)
    private String category;
}
